﻿namespace WinForms.ControlList.Systems
{
    using Bll.Systems;
    using Model.Systems;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.InteropServices;
    using System.Windows.Forms;
    using WinForms;
    using WinForms.Properties;

    public class FrmPrintSetting : Form
    {
        private Button btn_Close;
        private Button btn_Save;
        private IContainer components = null;
        private ComboBoxNew drp_CkZz;
        private ComboBoxNew drp_CkZzSource;
        private ComboBoxNew drp_RkZz;
        private ComboBoxNew drp_RkZzSource;
        private GroupBox groupBox1;
        private GroupBox groupBox2;
        private GroupBox groupBox3;
        private GroupBox groupBox4;
        private GroupBox groupBox5;
        private GroupBox groupBox6;
        public const int HTCAPTION = 2;
        private Label label1;
        private Label label2;
        private Label label3;
        private Label label4;
        private Label label5;
        private Label label6;
        private Label label7;
        private Label label8;
        private Label lbl_RkBottomMargins;
        private Label lbl_RkLeftMargins;
        private Label lbl_RkRightMargins;
        private Label lbl_RkTopMargins;
        private Label lblTitle;
        private Panel pan_AllPanel;
        private Panel pan_AllPlanes;
        private Panel pan_Bottoms;
        private Panel pan_Dock;
        private Panel pan_DockBottom;
        private Panel pan_DockLeft;
        private Panel pan_DockRight;
        private Panel pan_Lefts;
        private Panel pan_Rights;
        private Panel pan_Top;
        private Panel pan_TopLeft;
        private Panel pan_TopRight;
        private Panel pan_ZhongJian;
        private Panel pane_TopT;
        private Panel panel_Button;
        private Panel panel9;
        private RadioButton rad_CkPortrait;
        private RadioButton rad_CkTransverse;
        private RadioButton rad_RkPortrait;
        private RadioButton rad_RkTransverse;
        public const int SC_MOVE = 0xf010;
        private TabControl tab_Two;
        private TabPage tabPage1;
        private TabPage tabPage2;
        private TextBox txt_CkBottomMargins;
        private TextBox txt_CkLeftMargins;
        private TextBox txt_CkRightMargins;
        private TextBox txt_CkTopMargins;
        private TextBox txt_RkBottomMargins;
        private TextBox txt_RkLeftMargins;
        private TextBox txt_RkRightMargins;
        private TextBox txt_RkTopMargins;
        public const int WM_SYSCOMMAND = 0x112;

        public FrmPrintSetting()
        {
            this.InitializeComponent();
            base.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            base.SetStyle(ControlStyles.UserPaint, true);
            base.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            this.drp_RkZz.Items.Clear();
            this.drp_RkZz.AddItem("A4", "A4");
            this.drp_RkZz.AddItem("A3", "A3");
            this.drp_RkZz.AddItem("B5", "B5");
            this.drp_RkZz.AddItem("B6", "B6");
            this.drp_RkZz.SelectedIndex = 0;
            this.drp_RkZzSource.Items.Clear();
            this.drp_RkZzSource.AddItem("自动选择", "AutoSelect");
            this.drp_RkZzSource.SelectedIndex = 0;
            this.txt_RkLeftMargins.Text = "17";
            this.txt_RkRightMargins.Text = "0.00";
            this.txt_RkTopMargins.Text = "0.00";
            this.txt_RkBottomMargins.Text = "0.00";
            this.rad_RkTransverse.Checked = true;
            this.drp_CkZz.Items.Clear();
            this.drp_CkZz.AddItem("A4", "A4");
            this.drp_CkZz.AddItem("A3", "A3");
            this.drp_CkZz.AddItem("B5", "B5");
            this.drp_CkZz.AddItem("B6", "B6");
            this.drp_CkZz.SelectedIndex = 0;
            this.drp_CkZzSource.Items.Clear();
            this.drp_CkZzSource.AddItem("自动选择", "AutoSelect");
            this.drp_CkZzSource.SelectedIndex = 0;
            this.txt_CkLeftMargins.Text = "17";
            this.txt_CkRightMargins.Text = "0.00";
            this.txt_CkTopMargins.Text = "0.00";
            this.txt_CkBottomMargins.Text = "0.00";
            this.rad_RkTransverse.Checked = true;
            DataTable list = PrintSettingBll.GetList("");
            if (list.Rows.Count > 0)
            {
                foreach (DataRow row in list.Rows)
                {
                    if (row["DocumentName"].ToString() == "采购单")
                    {
                        this.drp_RkZz.Text = row["PageSize"].ToString();
                        if (row["HengXiangZongXiang"].ToString() == "0")
                        {
                            this.rad_RkPortrait.Checked = true;
                        }
                        else
                        {
                            this.rad_RkTransverse.Checked = true;
                        }
                        this.txt_RkLeftMargins.Text = row["LeftMargin"].ToString();
                        this.txt_RkRightMargins.Text = row["RightMargin"].ToString();
                        this.txt_RkTopMargins.Text = row["TopMargin"].ToString();
                        this.txt_RkBottomMargins.Text = row["BottomMargin"].ToString();
                    }
                    else if (row["DocumentName"].ToString() == "销售单")
                    {
                        this.drp_CkZz.Text = row["PageSize"].ToString();
                        if (row["HengXiangZongXiang"].ToString() == "0")
                        {
                            this.rad_CkPortrait.Checked = true;
                        }
                        else
                        {
                            this.rad_CkTransverse.Checked = true;
                        }
                        this.txt_CkLeftMargins.Text = row["LeftMargin"].ToString();
                        this.txt_CkRightMargins.Text = row["RightMargin"].ToString();
                        this.txt_CkTopMargins.Text = row["TopMargin"].ToString();
                        this.txt_CkBottomMargins.Text = row["BottomMargin"].ToString();
                    }
                }
            }
        }

        private void btn_Close_Click(object sender, EventArgs e)
        {
            base.Close();
        }

        private void btn_Save_Click(object sender, EventArgs e)
        {
            PrintSettingEnt model;
            UserEnt loginUser;
            PrintSettingEnt ent3;
            DataTable list = PrintSettingBll.GetList("");
            if (list.Rows.Count <= 0)
            {
                model = new PrintSettingEnt {
                    BottomMargin = decimal.Parse(this.txt_RkBottomMargins.Text),
                    DocumentName = "采购单"
                };
                if (this.rad_RkPortrait.Checked)
                {
                    model.HengXiangZongXiang = 0;
                }
                else
                {
                    model.HengXiangZongXiang = 1;
                }
                model.LeftMargin = decimal.Parse(this.txt_RkLeftMargins.Text);
                model.PageSize = this.drp_RkZz.SelectValueNew;
                model.RightMargin = decimal.Parse(this.txt_RkRightMargins.Text);
                model.SettingId = 1;
                model.TopMargin = decimal.Parse(this.txt_RkTopMargins.Text);
                loginUser = PublicAppliction.LoginUser;
                model.ChainNum = loginUser.ChainNum;
                PrintSettingBll.Add(model);
                ent3 = new PrintSettingEnt {
                    BottomMargin = decimal.Parse(this.txt_CkBottomMargins.Text),
                    DocumentName = "销售单"
                };
                if (this.rad_CkPortrait.Checked)
                {
                    ent3.HengXiangZongXiang = 0;
                }
                else
                {
                    ent3.HengXiangZongXiang = 1;
                }
                ent3.LeftMargin = decimal.Parse(this.txt_CkLeftMargins.Text);
                ent3.PageSize = this.drp_CkZz.SelectValueNew;
                ent3.RightMargin = decimal.Parse(this.txt_CkRightMargins.Text);
                ent3.SettingId = 2;
                ent3.TopMargin = decimal.Parse(this.txt_CkTopMargins.Text);
                ent3.ChainNum = loginUser.ChainNum;
                PrintSettingBll.Add(ent3);
                base.DialogResult = DialogResult.OK;
            }
            else
            {
                foreach (DataRow row in list.Rows)
                {
                    if (row["DocumentName"].ToString() == "采购单")
                    {
                        model = PrintSettingBll.GetModel(int.Parse(row["SettingId"].ToString()));
                        model.BottomMargin = decimal.Parse(this.txt_RkBottomMargins.Text);
                        if (this.rad_RkPortrait.Checked)
                        {
                            model.HengXiangZongXiang = 0;
                        }
                        else
                        {
                            model.HengXiangZongXiang = 1;
                        }
                        model.LeftMargin = decimal.Parse(this.txt_RkLeftMargins.Text);
                        model.PageSize = this.drp_RkZz.SelectValueNew;
                        model.RightMargin = decimal.Parse(this.txt_RkRightMargins.Text);
                        model.TopMargin = decimal.Parse(this.txt_RkTopMargins.Text);
                        loginUser = PublicAppliction.LoginUser;
                        model.ChainNum = loginUser.ChainNum;
                        PrintSettingBll.Update(model);
                    }
                    else if (row["DocumentName"].ToString() == "销售单")
                    {
                        ent3 = PrintSettingBll.GetModel(int.Parse(row["SettingId"].ToString()));
                        ent3.BottomMargin = decimal.Parse(this.txt_CkBottomMargins.Text);
                        if (this.rad_CkPortrait.Checked)
                        {
                            ent3.HengXiangZongXiang = 0;
                        }
                        else
                        {
                            ent3.HengXiangZongXiang = 1;
                        }
                        ent3.LeftMargin = decimal.Parse(this.txt_CkLeftMargins.Text);
                        ent3.PageSize = this.drp_CkZz.SelectValueNew;
                        ent3.TopMargin = decimal.Parse(this.txt_CkTopMargins.Text);
                        PrintSettingBll.Update(ent3);
                    }
                }
                base.DialogResult = DialogResult.OK;
            }
            MessageBox.Show("打印信息保存成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
            base.Close();
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.pan_DockLeft = new Panel();
            this.pan_Dock = new Panel();
            this.pan_AllPanel = new Panel();
            this.pan_AllPlanes = new Panel();
            this.tab_Two = new TabControl();
            this.tabPage1 = new TabPage();
            this.groupBox3 = new GroupBox();
            this.txt_RkBottomMargins = new TextBox();
            this.lbl_RkBottomMargins = new Label();
            this.txt_RkRightMargins = new TextBox();
            this.lbl_RkRightMargins = new Label();
            this.txt_RkTopMargins = new TextBox();
            this.lbl_RkTopMargins = new Label();
            this.txt_RkLeftMargins = new TextBox();
            this.lbl_RkLeftMargins = new Label();
            this.groupBox2 = new GroupBox();
            this.rad_RkTransverse = new RadioButton();
            this.rad_RkPortrait = new RadioButton();
            this.groupBox1 = new GroupBox();
            this.drp_RkZzSource = new ComboBoxNew();
            this.drp_RkZz = new ComboBoxNew();
            this.label2 = new Label();
            this.label1 = new Label();
            this.tabPage2 = new TabPage();
            this.groupBox4 = new GroupBox();
            this.txt_CkBottomMargins = new TextBox();
            this.label3 = new Label();
            this.txt_CkRightMargins = new TextBox();
            this.label4 = new Label();
            this.txt_CkTopMargins = new TextBox();
            this.label5 = new Label();
            this.txt_CkLeftMargins = new TextBox();
            this.label6 = new Label();
            this.groupBox5 = new GroupBox();
            this.rad_CkTransverse = new RadioButton();
            this.rad_CkPortrait = new RadioButton();
            this.groupBox6 = new GroupBox();
            this.drp_CkZzSource = new ComboBoxNew();
            this.drp_CkZz = new ComboBoxNew();
            this.label7 = new Label();
            this.label8 = new Label();
            this.panel_Button = new Panel();
            this.btn_Close = new Button();
            this.btn_Save = new Button();
            this.panel9 = new Panel();
            this.pan_Rights = new Panel();
            this.pan_Lefts = new Panel();
            this.pan_Bottoms = new Panel();
            this.pane_TopT = new Panel();
            this.pan_DockBottom = new Panel();
            this.pan_DockRight = new Panel();
            this.pan_Top = new Panel();
            this.pan_ZhongJian = new Panel();
            this.lblTitle = new Label();
            this.pan_TopRight = new Panel();
            this.pan_TopLeft = new Panel();
            this.pan_Dock.SuspendLayout();
            this.pan_AllPanel.SuspendLayout();
            this.pan_AllPlanes.SuspendLayout();
            this.tab_Two.SuspendLayout();
            this.tabPage1.SuspendLayout();
            this.groupBox3.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox1.SuspendLayout();
            this.tabPage2.SuspendLayout();
            this.groupBox4.SuspendLayout();
            this.groupBox5.SuspendLayout();
            this.groupBox6.SuspendLayout();
            this.panel_Button.SuspendLayout();
            this.pan_Top.SuspendLayout();
            this.pan_ZhongJian.SuspendLayout();
            base.SuspendLayout();
            this.pan_DockLeft.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockLeft.Dock = DockStyle.Left;
            this.pan_DockLeft.Location = new Point(0, 0);
            this.pan_DockLeft.Name = "pan_DockLeft";
            this.pan_DockLeft.Size = new Size(1, 0x15b);
            this.pan_DockLeft.TabIndex = 0;
            this.pan_Dock.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.pan_Dock.Controls.Add(this.pan_AllPanel);
            this.pan_Dock.Controls.Add(this.pan_DockBottom);
            this.pan_Dock.Controls.Add(this.pan_DockRight);
            this.pan_Dock.Controls.Add(this.pan_DockLeft);
            this.pan_Dock.Dock = DockStyle.Fill;
            this.pan_Dock.Location = new Point(0, 0x20);
            this.pan_Dock.Name = "pan_Dock";
            this.pan_Dock.Size = new Size(0x1f2, 0x15b);
            this.pan_Dock.TabIndex = 5;
            this.pan_AllPanel.BackColor = Color.White;
            this.pan_AllPanel.Controls.Add(this.pan_AllPlanes);
            this.pan_AllPanel.Controls.Add(this.pan_Rights);
            this.pan_AllPanel.Controls.Add(this.pan_Lefts);
            this.pan_AllPanel.Controls.Add(this.pan_Bottoms);
            this.pan_AllPanel.Controls.Add(this.pane_TopT);
            this.pan_AllPanel.Dock = DockStyle.Fill;
            this.pan_AllPanel.Location = new Point(1, 0);
            this.pan_AllPanel.Name = "pan_AllPanel";
            this.pan_AllPanel.Size = new Size(0x1f0, 0x15a);
            this.pan_AllPanel.TabIndex = 3;
            this.pan_AllPlanes.Controls.Add(this.tab_Two);
            this.pan_AllPlanes.Controls.Add(this.panel_Button);
            this.pan_AllPlanes.Controls.Add(this.panel9);
            this.pan_AllPlanes.Dock = DockStyle.Fill;
            this.pan_AllPlanes.Location = new Point(10, 10);
            this.pan_AllPlanes.Name = "pan_AllPlanes";
            this.pan_AllPlanes.Size = new Size(0x1dc, 0x146);
            this.pan_AllPlanes.TabIndex = 4;
            this.tab_Two.Controls.Add(this.tabPage1);
            this.tab_Two.Controls.Add(this.tabPage2);
            this.tab_Two.Dock = DockStyle.Fill;
            this.tab_Two.Location = new Point(0, 0);
            this.tab_Two.Name = "tab_Two";
            this.tab_Two.SelectedIndex = 0;
            this.tab_Two.Size = new Size(0x1dc, 0x11c);
            this.tab_Two.TabIndex = 8;
            this.tabPage1.Controls.Add(this.groupBox3);
            this.tabPage1.Controls.Add(this.groupBox2);
            this.tabPage1.Controls.Add(this.groupBox1);
            this.tabPage1.Location = new Point(4, 0x15);
            this.tabPage1.Name = "tabPage1";
            this.tabPage1.Padding = new Padding(3);
            this.tabPage1.Size = new Size(0x1d4, 0x103);
            this.tabPage1.TabIndex = 0;
            this.tabPage1.Text = "入库单设置";
            this.tabPage1.UseVisualStyleBackColor = true;
            this.groupBox3.Controls.Add(this.txt_RkBottomMargins);
            this.groupBox3.Controls.Add(this.lbl_RkBottomMargins);
            this.groupBox3.Controls.Add(this.txt_RkRightMargins);
            this.groupBox3.Controls.Add(this.lbl_RkRightMargins);
            this.groupBox3.Controls.Add(this.txt_RkTopMargins);
            this.groupBox3.Controls.Add(this.lbl_RkTopMargins);
            this.groupBox3.Controls.Add(this.txt_RkLeftMargins);
            this.groupBox3.Controls.Add(this.lbl_RkLeftMargins);
            this.groupBox3.Location = new Point(0xc6, 0x80);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new Size(250, 0x72);
            this.groupBox3.TabIndex = 2;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "页边距";
            this.txt_RkBottomMargins.Location = new Point(0xb2, 0x42);
            this.txt_RkBottomMargins.Name = "txt_RkBottomMargins";
            this.txt_RkBottomMargins.Size = new Size(0x37, 0x15);
            this.txt_RkBottomMargins.TabIndex = 7;
            this.txt_RkBottomMargins.KeyPress += new KeyPressEventHandler(this.txt_RkBottomMargins_KeyPress);
            this.lbl_RkBottomMargins.AutoSize = true;
            this.lbl_RkBottomMargins.Location = new Point(0x83, 0x47);
            this.lbl_RkBottomMargins.Name = "lbl_RkBottomMargins";
            this.lbl_RkBottomMargins.Size = new Size(0x2f, 12);
            this.lbl_RkBottomMargins.TabIndex = 6;
            this.lbl_RkBottomMargins.Text = "下边距:";
            this.txt_RkRightMargins.Location = new Point(0xb2, 0x1c);
            this.txt_RkRightMargins.Name = "txt_RkRightMargins";
            this.txt_RkRightMargins.Size = new Size(0x37, 0x15);
            this.txt_RkRightMargins.TabIndex = 5;
            this.txt_RkRightMargins.KeyPress += new KeyPressEventHandler(this.txt_RkRightMargins_KeyPress);
            this.lbl_RkRightMargins.AutoSize = true;
            this.lbl_RkRightMargins.Location = new Point(0x83, 0x21);
            this.lbl_RkRightMargins.Name = "lbl_RkRightMargins";
            this.lbl_RkRightMargins.Size = new Size(0x2f, 12);
            this.lbl_RkRightMargins.TabIndex = 4;
            this.lbl_RkRightMargins.Text = "右边距:";
            this.txt_RkTopMargins.Location = new Point(0x40, 0x42);
            this.txt_RkTopMargins.Name = "txt_RkTopMargins";
            this.txt_RkTopMargins.Size = new Size(0x37, 0x15);
            this.txt_RkTopMargins.TabIndex = 3;
            this.txt_RkTopMargins.KeyPress += new KeyPressEventHandler(this.txt_RkTopMargins_KeyPress);
            this.lbl_RkTopMargins.AutoSize = true;
            this.lbl_RkTopMargins.Location = new Point(0x11, 0x47);
            this.lbl_RkTopMargins.Name = "lbl_RkTopMargins";
            this.lbl_RkTopMargins.Size = new Size(0x2f, 12);
            this.lbl_RkTopMargins.TabIndex = 2;
            this.lbl_RkTopMargins.Text = "上边距:";
            this.txt_RkLeftMargins.Location = new Point(0x40, 0x1c);
            this.txt_RkLeftMargins.Name = "txt_RkLeftMargins";
            this.txt_RkLeftMargins.Size = new Size(0x37, 0x15);
            this.txt_RkLeftMargins.TabIndex = 1;
            this.txt_RkLeftMargins.KeyPress += new KeyPressEventHandler(this.txt_RkLeftMargins_KeyPress);
            this.lbl_RkLeftMargins.AutoSize = true;
            this.lbl_RkLeftMargins.Location = new Point(0x11, 0x21);
            this.lbl_RkLeftMargins.Name = "lbl_RkLeftMargins";
            this.lbl_RkLeftMargins.Size = new Size(0x2f, 12);
            this.lbl_RkLeftMargins.TabIndex = 0;
            this.lbl_RkLeftMargins.Text = "左边距:";
            this.groupBox2.Controls.Add(this.rad_RkTransverse);
            this.groupBox2.Controls.Add(this.rad_RkPortrait);
            this.groupBox2.Location = new Point(0x16, 0x80);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new Size(0x9d, 0x72);
            this.groupBox2.TabIndex = 1;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "方向";
            this.rad_RkTransverse.AutoSize = true;
            this.rad_RkTransverse.Location = new Point(0x1f, 0x42);
            this.rad_RkTransverse.Name = "rad_RkTransverse";
            this.rad_RkTransverse.Size = new Size(0x47, 0x10);
            this.rad_RkTransverse.TabIndex = 1;
            this.rad_RkTransverse.TabStop = true;
            this.rad_RkTransverse.Text = "横向打印";
            this.rad_RkTransverse.UseVisualStyleBackColor = true;
            this.rad_RkPortrait.AutoSize = true;
            this.rad_RkPortrait.Location = new Point(0x1f, 0x20);
            this.rad_RkPortrait.Name = "rad_RkPortrait";
            this.rad_RkPortrait.Size = new Size(0x47, 0x10);
            this.rad_RkPortrait.TabIndex = 0;
            this.rad_RkPortrait.TabStop = true;
            this.rad_RkPortrait.Text = "纵向打印";
            this.rad_RkPortrait.UseVisualStyleBackColor = true;
            this.groupBox1.Controls.Add(this.drp_RkZzSource);
            this.groupBox1.Controls.Add(this.drp_RkZz);
            this.groupBox1.Controls.Add(this.label2);
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Location = new Point(0x15, 0x11);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new Size(0x1ab, 100);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "纸张";
            this.drp_RkZzSource.DisplayMember = "Name";
            this.drp_RkZzSource.DropDownStyle = ComboBoxStyle.DropDownList;
            this.drp_RkZzSource.FormattingEnabled = true;
            this.drp_RkZzSource.Location = new Point(0x44, 0x37);
            this.drp_RkZzSource.Name = "drp_RkZzSource";
            this.drp_RkZzSource.SelectValueNew = "";
            this.drp_RkZzSource.Size = new Size(0x14b, 20);
            this.drp_RkZzSource.TabIndex = 3;
            this.drp_RkZzSource.ValueMember = "Value";
            this.drp_RkZz.DisplayMember = "Name";
            this.drp_RkZz.DropDownStyle = ComboBoxStyle.DropDownList;
            this.drp_RkZz.FormattingEnabled = true;
            this.drp_RkZz.Location = new Point(0x44, 0x17);
            this.drp_RkZz.Name = "drp_RkZz";
            this.drp_RkZz.SelectValueNew = "";
            this.drp_RkZz.Size = new Size(0x14b, 20);
            this.drp_RkZz.TabIndex = 2;
            this.drp_RkZz.ValueMember = "Value";
            this.label2.AutoSize = true;
            this.label2.Location = new Point(0x1b, 60);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x23, 12);
            this.label2.TabIndex = 1;
            this.label2.Text = "来源:";
            this.label1.AutoSize = true;
            this.label1.Location = new Point(0x1b, 0x1c);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x23, 12);
            this.label1.TabIndex = 0;
            this.label1.Text = "纸张:";
            this.tabPage2.Controls.Add(this.groupBox4);
            this.tabPage2.Controls.Add(this.groupBox5);
            this.tabPage2.Controls.Add(this.groupBox6);
            this.tabPage2.Location = new Point(4, 0x15);
            this.tabPage2.Name = "tabPage2";
            this.tabPage2.Padding = new Padding(3);
            this.tabPage2.Size = new Size(0x1d4, 0x103);
            this.tabPage2.TabIndex = 1;
            this.tabPage2.Text = "销售单设置";
            this.tabPage2.UseVisualStyleBackColor = true;
            this.groupBox4.Controls.Add(this.txt_CkBottomMargins);
            this.groupBox4.Controls.Add(this.label3);
            this.groupBox4.Controls.Add(this.txt_CkRightMargins);
            this.groupBox4.Controls.Add(this.label4);
            this.groupBox4.Controls.Add(this.txt_CkTopMargins);
            this.groupBox4.Controls.Add(this.label5);
            this.groupBox4.Controls.Add(this.txt_CkLeftMargins);
            this.groupBox4.Controls.Add(this.label6);
            this.groupBox4.Location = new Point(0xc6, 0x80);
            this.groupBox4.Name = "groupBox4";
            this.groupBox4.Size = new Size(250, 0x72);
            this.groupBox4.TabIndex = 5;
            this.groupBox4.TabStop = false;
            this.groupBox4.Text = "页边距";
            this.txt_CkBottomMargins.Location = new Point(0xb2, 0x42);
            this.txt_CkBottomMargins.Name = "txt_CkBottomMargins";
            this.txt_CkBottomMargins.Size = new Size(0x37, 0x15);
            this.txt_CkBottomMargins.TabIndex = 7;
            this.txt_CkBottomMargins.KeyPress += new KeyPressEventHandler(this.txt_CkBottomMargins_KeyPress);
            this.label3.AutoSize = true;
            this.label3.Location = new Point(0x83, 0x47);
            this.label3.Name = "label3";
            this.label3.Size = new Size(0x2f, 12);
            this.label3.TabIndex = 6;
            this.label3.Text = "下边距:";
            this.txt_CkRightMargins.Location = new Point(0xb2, 0x1c);
            this.txt_CkRightMargins.Name = "txt_CkRightMargins";
            this.txt_CkRightMargins.Size = new Size(0x37, 0x15);
            this.txt_CkRightMargins.TabIndex = 5;
            this.txt_CkRightMargins.KeyPress += new KeyPressEventHandler(this.txt_CkRightMargins_KeyPress);
            this.label4.AutoSize = true;
            this.label4.Location = new Point(0x83, 0x21);
            this.label4.Name = "label4";
            this.label4.Size = new Size(0x2f, 12);
            this.label4.TabIndex = 4;
            this.label4.Text = "右边距:";
            this.txt_CkTopMargins.Location = new Point(0x40, 0x42);
            this.txt_CkTopMargins.Name = "txt_CkTopMargins";
            this.txt_CkTopMargins.Size = new Size(0x37, 0x15);
            this.txt_CkTopMargins.TabIndex = 3;
            this.txt_CkTopMargins.KeyPress += new KeyPressEventHandler(this.txt_CkTopMargins_KeyPress);
            this.label5.AutoSize = true;
            this.label5.Location = new Point(0x11, 0x47);
            this.label5.Name = "label5";
            this.label5.Size = new Size(0x2f, 12);
            this.label5.TabIndex = 2;
            this.label5.Text = "上边距:";
            this.txt_CkLeftMargins.Location = new Point(0x40, 0x1c);
            this.txt_CkLeftMargins.Name = "txt_CkLeftMargins";
            this.txt_CkLeftMargins.Size = new Size(0x37, 0x15);
            this.txt_CkLeftMargins.TabIndex = 1;
            this.txt_CkLeftMargins.KeyPress += new KeyPressEventHandler(this.txt_CkLeftMargins_KeyPress);
            this.label6.AutoSize = true;
            this.label6.Location = new Point(0x11, 0x21);
            this.label6.Name = "label6";
            this.label6.Size = new Size(0x2f, 12);
            this.label6.TabIndex = 0;
            this.label6.Text = "左边距:";
            this.groupBox5.Controls.Add(this.rad_CkTransverse);
            this.groupBox5.Controls.Add(this.rad_CkPortrait);
            this.groupBox5.Location = new Point(0x16, 0x80);
            this.groupBox5.Name = "groupBox5";
            this.groupBox5.Size = new Size(0x9d, 0x72);
            this.groupBox5.TabIndex = 4;
            this.groupBox5.TabStop = false;
            this.groupBox5.Text = "方向";
            this.rad_CkTransverse.AutoSize = true;
            this.rad_CkTransverse.Location = new Point(0x1f, 0x42);
            this.rad_CkTransverse.Name = "rad_CkTransverse";
            this.rad_CkTransverse.Size = new Size(0x47, 0x10);
            this.rad_CkTransverse.TabIndex = 1;
            this.rad_CkTransverse.TabStop = true;
            this.rad_CkTransverse.Text = "横向打印";
            this.rad_CkTransverse.UseVisualStyleBackColor = true;
            this.rad_CkPortrait.AutoSize = true;
            this.rad_CkPortrait.Location = new Point(0x1f, 0x20);
            this.rad_CkPortrait.Name = "rad_CkPortrait";
            this.rad_CkPortrait.Size = new Size(0x47, 0x10);
            this.rad_CkPortrait.TabIndex = 0;
            this.rad_CkPortrait.TabStop = true;
            this.rad_CkPortrait.Text = "纵向打印";
            this.rad_CkPortrait.UseVisualStyleBackColor = true;
            this.groupBox6.Controls.Add(this.drp_CkZzSource);
            this.groupBox6.Controls.Add(this.drp_CkZz);
            this.groupBox6.Controls.Add(this.label7);
            this.groupBox6.Controls.Add(this.label8);
            this.groupBox6.Location = new Point(0x15, 0x11);
            this.groupBox6.Name = "groupBox6";
            this.groupBox6.Size = new Size(0x1ab, 100);
            this.groupBox6.TabIndex = 3;
            this.groupBox6.TabStop = false;
            this.groupBox6.Text = "纸张";
            this.drp_CkZzSource.DisplayMember = "Name";
            this.drp_CkZzSource.DropDownStyle = ComboBoxStyle.DropDownList;
            this.drp_CkZzSource.FormattingEnabled = true;
            this.drp_CkZzSource.Location = new Point(0x44, 0x37);
            this.drp_CkZzSource.Name = "drp_CkZzSource";
            this.drp_CkZzSource.SelectValueNew = "";
            this.drp_CkZzSource.Size = new Size(0x14b, 20);
            this.drp_CkZzSource.TabIndex = 3;
            this.drp_CkZzSource.ValueMember = "Value";
            this.drp_CkZz.DisplayMember = "Name";
            this.drp_CkZz.DropDownStyle = ComboBoxStyle.DropDownList;
            this.drp_CkZz.FormattingEnabled = true;
            this.drp_CkZz.Location = new Point(0x44, 0x17);
            this.drp_CkZz.Name = "drp_CkZz";
            this.drp_CkZz.SelectValueNew = "";
            this.drp_CkZz.Size = new Size(0x14b, 20);
            this.drp_CkZz.TabIndex = 2;
            this.drp_CkZz.ValueMember = "Value";
            this.label7.AutoSize = true;
            this.label7.Location = new Point(0x1b, 60);
            this.label7.Name = "label7";
            this.label7.Size = new Size(0x23, 12);
            this.label7.TabIndex = 1;
            this.label7.Text = "来源:";
            this.label8.AutoSize = true;
            this.label8.Location = new Point(0x1b, 0x1c);
            this.label8.Name = "label8";
            this.label8.Size = new Size(0x23, 12);
            this.label8.TabIndex = 0;
            this.label8.Text = "纸张:";
            this.panel_Button.Controls.Add(this.btn_Close);
            this.panel_Button.Controls.Add(this.btn_Save);
            this.panel_Button.Dock = DockStyle.Bottom;
            this.panel_Button.Location = new Point(0, 0x11c);
            this.panel_Button.Name = "panel_Button";
            this.panel_Button.Size = new Size(0x1dc, 0x25);
            this.panel_Button.TabIndex = 7;
            this.panel_Button.Paint += new PaintEventHandler(this.panel_Button_Paint);
            this.btn_Close.Location = new Point(0x10b, 7);
            this.btn_Close.Name = "btn_Close";
            this.btn_Close.Size = new Size(0x4b, 0x17);
            this.btn_Close.TabIndex = 0;
            this.btn_Close.Text = "关 闭";
            this.btn_Close.UseVisualStyleBackColor = true;
            this.btn_Close.Click += new EventHandler(this.btn_Close_Click);
            this.btn_Save.Location = new Point(0x86, 7);
            this.btn_Save.Name = "btn_Save";
            this.btn_Save.Size = new Size(0x4b, 0x17);
            this.btn_Save.TabIndex = 1;
            this.btn_Save.Text = "保 存";
            this.btn_Save.UseVisualStyleBackColor = true;
            this.btn_Save.Click += new EventHandler(this.btn_Save_Click);
            this.panel9.Dock = DockStyle.Bottom;
            this.panel9.Location = new Point(0, 0x141);
            this.panel9.Name = "panel9";
            this.panel9.Size = new Size(0x1dc, 5);
            this.panel9.TabIndex = 3;
            this.pan_Rights.Dock = DockStyle.Right;
            this.pan_Rights.Location = new Point(0x1e6, 10);
            this.pan_Rights.Name = "pan_Rights";
            this.pan_Rights.Size = new Size(10, 0x146);
            this.pan_Rights.TabIndex = 3;
            this.pan_Lefts.Dock = DockStyle.Left;
            this.pan_Lefts.Location = new Point(0, 10);
            this.pan_Lefts.Name = "pan_Lefts";
            this.pan_Lefts.Size = new Size(10, 0x146);
            this.pan_Lefts.TabIndex = 2;
            this.pan_Bottoms.Dock = DockStyle.Bottom;
            this.pan_Bottoms.Location = new Point(0, 0x150);
            this.pan_Bottoms.Name = "pan_Bottoms";
            this.pan_Bottoms.Size = new Size(0x1f0, 10);
            this.pan_Bottoms.TabIndex = 1;
            this.pane_TopT.Dock = DockStyle.Top;
            this.pane_TopT.Location = new Point(0, 0);
            this.pane_TopT.Name = "pane_TopT";
            this.pane_TopT.Size = new Size(0x1f0, 10);
            this.pane_TopT.TabIndex = 0;
            this.pan_DockBottom.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockBottom.Dock = DockStyle.Bottom;
            this.pan_DockBottom.Location = new Point(1, 0x15a);
            this.pan_DockBottom.Name = "pan_DockBottom";
            this.pan_DockBottom.Size = new Size(0x1f0, 1);
            this.pan_DockBottom.TabIndex = 2;
            this.pan_DockRight.BackColor = Color.FromArgb(0xaf, 0xbf, 190);
            this.pan_DockRight.Dock = DockStyle.Right;
            this.pan_DockRight.Location = new Point(0x1f1, 0);
            this.pan_DockRight.Name = "pan_DockRight";
            this.pan_DockRight.Size = new Size(1, 0x15b);
            this.pan_DockRight.TabIndex = 1;
            this.pan_Top.Controls.Add(this.pan_ZhongJian);
            this.pan_Top.Controls.Add(this.pan_TopRight);
            this.pan_Top.Controls.Add(this.pan_TopLeft);
            this.pan_Top.Dock = DockStyle.Top;
            this.pan_Top.Location = new Point(0, 0);
            this.pan_Top.Name = "pan_Top";
            this.pan_Top.Size = new Size(0x1f2, 0x20);
            this.pan_Top.TabIndex = 4;
            this.pan_ZhongJian.BackgroundImage = Resources.uc_title_2;
            this.pan_ZhongJian.Controls.Add(this.lblTitle);
            this.pan_ZhongJian.Dock = DockStyle.Fill;
            this.pan_ZhongJian.Location = new Point(0x1f, 0);
            this.pan_ZhongJian.Name = "pan_ZhongJian";
            this.pan_ZhongJian.Size = new Size(0x1ce, 0x20);
            this.pan_ZhongJian.TabIndex = 2;
            this.pan_ZhongJian.MouseDown += new MouseEventHandler(this.pan_ZhongJian_MouseDown);
            this.lblTitle.AutoSize = true;
            this.lblTitle.BackColor = Color.FromArgb(0, 0, 15, 0xff);
            this.lblTitle.Font = new Font("宋体", 9.75f, FontStyle.Bold, GraphicsUnit.Point, 0x86);
            this.lblTitle.ForeColor = Color.FromArgb(0x3b, 0x56, 20);
            this.lblTitle.Location = new Point(6, 8);
            this.lblTitle.Name = "lblTitle";
            this.lblTitle.Size = new Size(0x5b, 13);
            this.lblTitle.TabIndex = 0;
            this.lblTitle.Text = "单据打印设置";
            this.pan_TopRight.BackgroundImage = Resources.uc_title_1;
            this.pan_TopRight.Dock = DockStyle.Right;
            this.pan_TopRight.Location = new Point(0x1ed, 0);
            this.pan_TopRight.Name = "pan_TopRight";
            this.pan_TopRight.Size = new Size(5, 0x20);
            this.pan_TopRight.TabIndex = 1;
            this.pan_TopLeft.BackgroundImage = Resources.uc_title;
            this.pan_TopLeft.Dock = DockStyle.Left;
            this.pan_TopLeft.Location = new Point(0, 0);
            this.pan_TopLeft.Name = "pan_TopLeft";
            this.pan_TopLeft.Size = new Size(0x1f, 0x20);
            this.pan_TopLeft.TabIndex = 0;
            this.pan_TopLeft.MouseDown += new MouseEventHandler(this.pan_TopLeft_MouseDown);
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(0x1f2, 0x17b);
            base.Controls.Add(this.pan_Dock);
            base.Controls.Add(this.pan_Top);
            base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "FrmPrintSetting";
            base.ShowInTaskbar = false;
            this.pan_Dock.ResumeLayout(false);
            this.pan_AllPanel.ResumeLayout(false);
            this.pan_AllPlanes.ResumeLayout(false);
            this.tab_Two.ResumeLayout(false);
            this.tabPage1.ResumeLayout(false);
            this.groupBox3.ResumeLayout(false);
            this.groupBox3.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.tabPage2.ResumeLayout(false);
            this.groupBox4.ResumeLayout(false);
            this.groupBox4.PerformLayout();
            this.groupBox5.ResumeLayout(false);
            this.groupBox5.PerformLayout();
            this.groupBox6.ResumeLayout(false);
            this.groupBox6.PerformLayout();
            this.panel_Button.ResumeLayout(false);
            this.pan_Top.ResumeLayout(false);
            this.pan_ZhongJian.ResumeLayout(false);
            this.pan_ZhongJian.PerformLayout();
            base.ResumeLayout(false);
        }

        private void pan_TopLeft_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void pan_ZhongJian_MouseDown(object sender, MouseEventArgs e)
        {
            ReleaseCapture();
            SendMessage(base.Handle, 0x112, 0xf012, 0);
        }

        private void panel_Button_Paint(object sender, PaintEventArgs e)
        {
            this.Panel_ResetPaint(e, this.panel_Button, Color.FromArgb(0xca, 0xc9, 0xce), 1, 1, 1, 1);
        }

        private void Panel_ResetPaint(PaintEventArgs e, Panel panel, Color color, int leftBoder, int topBoder, int rightBoder, int bottomBoder)
        {
            ControlPaint.DrawBorder(e.Graphics, panel.ClientRectangle, color, leftBoder, ButtonBorderStyle.Solid, color, topBoder, ButtonBorderStyle.Solid, color, rightBoder, ButtonBorderStyle.Solid, color, bottomBoder, ButtonBorderStyle.Solid);
        }

        [DllImport("user32.dll")]
        public static extern bool ReleaseCapture();
        [DllImport("user32.dll")]
        public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
        private void txt_CkBottomMargins_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((e.KeyChar < '0') || (e.KeyChar > '9'))
            {
                e.Handled = true;
            }
        }

        private void txt_CkLeftMargins_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((e.KeyChar < '0') || (e.KeyChar > '9'))
            {
                e.Handled = true;
            }
        }

        private void txt_CkRightMargins_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((e.KeyChar < '0') || (e.KeyChar > '9'))
            {
                e.Handled = true;
            }
        }

        private void txt_CkTopMargins_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((e.KeyChar < '0') || (e.KeyChar > '9'))
            {
                e.Handled = true;
            }
        }

        private void txt_RkBottomMargins_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((e.KeyChar < '0') || (e.KeyChar > '9'))
            {
                e.Handled = true;
            }
        }

        private void txt_RkLeftMargins_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((e.KeyChar < '0') || (e.KeyChar > '9'))
            {
                e.Handled = true;
            }
        }

        private void txt_RkRightMargins_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((e.KeyChar < '0') || (e.KeyChar > '9'))
            {
                e.Handled = true;
            }
        }

        private void txt_RkTopMargins_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((e.KeyChar < '0') || (e.KeyChar > '9'))
            {
                e.Handled = true;
            }
        }
    }
}

